// 引入react核心包\
import React from 'react'
// 设计DOM来渲染的一个包
import ReactDom from 'react-dom'

// 条件渲染 isLoading是true加载中 false加载完毕

const render = () => {
	const isLoading = true

	let ele

	if (isLoading) {
		ele = <h1>加载中...</h1>
	} else {
		ele = <h1>加载完毕</h1>
	}

	return ele
}

const 三元表达式 = () => {
	const isLoading = false

	return <h1>{isLoading ? '加载中...' : '加载完毕'}</h1>
}

// 渲染谁，渲染到哪里
ReactDom.render(三元表达式(), document.querySelector('#root'))
